<?php

/**
 * formproblemevehicule form.
 *
 * @package    forumCDE
 * @subpackage form
 * @author     Your name here
 * @version    SVN: $Id: sfDoctrineFormTemplate.php 23810 2009-11-12 11:07:44Z Kris.Wallsmith $
 */
class formproblemevehiculeForm extends BaseformproblemevehiculeForm
{
  public function configure()
  {
  	$this->widgetSchema->setNameFormat('form[%s]');
  	$i18N = sfContext::getInstance()->getI18N();
  	$this->getWidget('codevehicule_id')->setOption('renderer_class', 'sfWidgetOptionsTouchscreen');
  	foreach ($this->objectDef->attributes as $fieldName => $attdef){
  		if($attdef['show'] && $attdef['type']=='BO' && $fieldName != 'codevehicule_id') {
  			$this->getWidget($fieldName . '_id')->setOption('expanded', true);
  			$this->getWidget($fieldName . '_id')->setOption('add_empty', $i18N->__('None'));
  			$this->getWidget($fieldName . '_id')->setAttribute('class', 'radioelement form');
  			//$this->getWidget($fieldName . '_id')->setOption('renderer_class', array($this, 'sfWidgetSelectRadioTouchscreen'));
  		}	
  	}
  	
  	
  	
  }
  
  public function radioListFormatter2($widget, $inputs)
	{
	    $rows = array();
	    foreach ($inputs as $i => $input)
	    {
	      $rows[] = $widget->renderContentTag(
	        	  'li', 
	                  $input['input'].$widget->getOption('label_separator').$input['label'],
	                  array('style'=>'list-style-type:none', 'id'=>'li_'.$i, 'onchange'=>$widget->getOption('onchange')) //Seule réelle modification par rapport à la fonction définie de base dans la classe sfWidgetFormSelectCheckbox
	                );
	    }
	    return $widget->renderContentTag('ul', '<br /><br />'.implode($widget->getOption('separator'), $rows), array('class' => 'radio_list'));
	}
  
}
